package com.baizhi.mall.service.impl;

import com.baizhi.mall.entity.mysql.BzBrandDO;
import com.baizhi.mall.mapper.BzBrandMapper;
import com.baizhi.mall.service.IBzBrandService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhw
 * @since 2021-05-17
 */
@Service
@Transactional
public class BzBrandServiceImpl extends ServiceImpl<BzBrandMapper, BzBrandDO> implements IBzBrandService {
    @Autowired
    private BzBrandMapper bm;
    @Override
    @Transactional(readOnly = true)
    public List<BzBrandDO> selectAll() {
        List<BzBrandDO> list=bm.selectList(null);
        return list;
    }

    @Override
    public void insert(BzBrandDO brand) {
        bm.insert(brand);
    }

    @Override
    public void delete(Integer id) {
        bm.deleteById(id);
    }

    @Override
    public void update(BzBrandDO brand) {
        bm.updateById(brand);
    }

    @Override
    public void updateStatus(Integer showStatus, Integer brandId) {
        bm.updateStatus(showStatus,brandId);
    }
}
